<?php
/**
 * Created by PhpStorm.
 * User: reshared
 * Date: 2017/10/2
 * Time: 上午10:49
 */

namespace Index\Repository;


use Index\Repository\Tra\InstanceTrait;

class CourseRepository extends BaseRepository
{
    use InstanceTrait;

    public function getFocus()
    {
        return $this->model('course')->focus();
    }

    public function focusFormat($list)
    {
        foreach ($list as &$item) {
            $item['course_image'] = $item['course_image'] ? url().$item['course_image'] : '';
            $item['course_focus_image'] = $item['course_focus_image'] ? url().$item['course_focus_image'] : '';
        }

        return $list;
    }
}